<?php

   /**
   *  file:           consumermanagement.php
   *  author:         chrisv
   *
   *  function:       gives user a list of HBC consumers at
   *                  various relocation stages.
   *
   *  dependencies:   datbase connection file, image files for
   *                  presentation and layout.
   *
   *  updated:        May 8th, 2007
   *
   *  notes:          just needs header and footer of template to give
   *                  uniform presentation.
   **/
   
   //get your hbc database connection
   include "./db_connect.php";
   
 //******************************************************************************//

   //GET ASSESSED CONSUMER RECORDS

   $select_consumers = "SELECT *
                        FROM hbc_consumers
                        WHERE consumer_status='assessed'";
                        
   /* HOLDS ASSESSED consumer data */                 
   $consumer_assessments = mysql_query($select_consumers) or die(mysql_error());
   
   //******************************************************************************//
   
   //GET RELOCATION PLANNED CONSUMER RECORDS
   
   $select_consumers2 = "SELECT *
                        FROM hbc_consumers
                        WHERE consumer_status='relocation planned'";
                        
   /* HOLDS RELOCATION PLANNED consumer data */                 
   $consumer_relocations_planned = mysql_query($select_consumers2) or die(mysql_error());
   
    //******************************************************************************//
    
   //GET RELOCATIONS COMPLETED CONSUMER RECORDS

   $select_consumers3 = "SELECT *
                        FROM hbc_consumers
                        WHERE consumer_status='relocation completed'";
                        
   /* HOLDS RELOCATIONS COMPLETED consumer data */                 
   $consumer_relocations_completed = mysql_query($select_consumers3) or die(mysql_error());
      
?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 STRICT//EN" 
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta name="author" content="nickadeemus2002 (www.addictedtocoding.us)" />
	<meta http-equiv="content-type" content="text/html;charset=iso-8859-2" />
	<link rel="stylesheet" href="images/style.css" type="text/css" />
	<title>Home By Choice Consumer Management Application: File Management</title>
   <meta http-equiv="CACHE-CONTROL" content="NO-CACHE"> 
   <meta http-equiv="PRAGMA" content="NO-CACHE">
   <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
   <style type="text/css">
   
	#control_panel_banner{
           font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 32px;
           font-weight: bold;
           color: #7B67AA; 
           text-align: center;
           border-top: 1px dashed #674495;
           border-bottom: 1px dashed #674495;
           background-color: #FFBB62; 
        }

	h2{
           font-family: Verdana, Helvetica, Arial, sans-serif;
           color: #7B67AA; 
           /* border-top: 1px dashed #674495;
           border-bottom: 1px dashed #674495; */
           background-color: #FFFF9D;
           padding: 10px 0px 10px 0px;
        }	

   </style>
</head>
<body>
<div class="content">
	
	   <!-- BEGIN HEADER RIGHT -->
		<div class="header_right">
      	
         <!-- Top Info LOG IN -->	
			<div class="top_info">
				<div class="top_info_right">
					<p><b>You are not Logged in!</b> &nbsp;&nbsp; &nbsp;&nbsp; Please <a href="#">LOG IN</a> to
               start managing files consumer files.</p>					
				</div>
			</div>
			<!-- END TOP INFO -->
					
		   <!-- Navigation Bar -->
      	<div class="bar">
				<ul>
					<li><a href="./index.php" title="Return to Main Page" accesskey="h">Home</a></li>
					<li class="active">HBC File Management</li>
					<li><a href="./maps.php" title="Click here to view Nursing Facility and Relocated Consumer information" accesskey="m">HBC Maps</li>
					<li><a href="./forms.php" title="Download HBC Forms" accesskey="f">HBC Forms</a></li>
					<li><a href="./../pligg/" title="Share information about relocation activities in Texas"accesskey="n">Relocation News</a></li>
				
				</ul>
			</div>
			<!-- END BAR -->			
		</div>
		<!-- END HEADER RIGHT -->


		<div class="logo">
			<h1><a href="#" title="Welcome to the Home By Choice Consumer App!">Home
             <span class="red">By Choice</span>
             </a>
         </h1>
		   <p>Project Information and Consumer Updates</p>
		</div>

		
		<div class="search_field">
			<form method="post" action="?">
				<p><span class="search">Search Box</span>&nbsp;&nbsp; 
               <input type="text" name="search" class="search" /> 
               <input type="submit" value="Find It!" class="button" /></p>
			</form>
		</div>

		
		<div class="newsletter">
			<p><strong><u>DADS REGIONS 4 , 5 & 7:</u></strong><br />ARCIL.CRCIL.ETCIL.HOCTIL.RISE</p>
		</div>

		
		<div class="subheader">
			<h1>HBC Consumer Overview & File Management:</h1>
			<p>Here is information about consumers at various stages of relocation. You may
            also add new consumer files or edit/update existing files.</p>
		</div>
</div>


<!-- FOR ARCIL -->
<div class="content">
   <table align="center" border="0px" cellpadding="0px" cellspacing="0px" width="760px">
      <tbody>
        <tr>
          <td>
	     <table border="0px" cellpadding="0px" cellspacing="0px" width="10px">
                <tbody>
	          <tr>
                    <td>


                       <table border="0" cellpadding="10" cellspacing="0" width="760">

		          <form name="hbc_consumer_data" method="get" action="" >
		             <tbody>
			        <tr bgcolor="FBAFCB">
				   <td class="style" colspan="4" style="padding-top:10px;">
                                      <div align="center" >
                                         <H1>Consumer Relocation Overview</H1>
                                      </div>
                                   </td>
	                         </tr> 
			                       
                                <!-- MAIN ASSESSMENTS TABLE -->
                                <tr>
				   <td align="center" bgcolor="#EEEEEE">
				      <h2>Initial Assessments:</h2>
				         <table cellpadding="5" cellspacing="0" border="1" width="100%" bordercolor="#ffffff" >
                                            <tr>
                                               <td  align="center"><strong>Fullname</strong></td>
					       <td  align="center"><strong>Consumer ID</strong></td>
					       <td  align="center"><strong>Date Taken</strong></td>
   				               <td  align="center"><strong>Nursing Facility</strong></td>
					       <td  align="center"><strong>Assigned Coordinator</strong></td>
					    </tr>

                                         <?php //GET ASSESSED CONSUMER DATA
                                              
                                              while($assessed_consumer_info = mysql_fetch_array($consumer_assessments)){
   
                                                   $assessed_consumer_id                =$assessed_consumer_info['consumer_id'];
                                                   $assessed_consumer_fullname          =$assessed_consumer_info['consumer_fullname'];
                                                   $assessed_consumer_date              =$assessed_consumer_info['consumer_date'];
                                                   $assessed_consumer_nursing_facility  =$assessed_consumer_info['consumer_nursing_facility'];
                                                   $assessed_consumer_coordinator       =$assessed_consumer_info['consumer_coordinator']; 
                                          ?>									      
                                             <tr>
                                                <td align="center">
                                                   <a href="show_profile.php?consumer_id=<?=$assessed_consumer_id?>">
                                                        <?=$assessed_consumer_fullname?>
                                                   </a>
                                                </td>
                                                <td class="style1" align="center" height="20px">
                                                   <?=$assessed_consumer_id?>
                                                </td>
					        <td class="style1" align="center" height="20px">
                                                   <?echo $assessed_consumer_date?>
                                                </td>
                                                <td class="style1" align="center" height="20px">
                                                   <?=$assessed_consumer_nursing_facility?>
                                                </td>
                                                <td class="style1" align="center" height="20px">
                                                  <?=$assessed_consumer_coordinator?>
                                                </td>											
			 	                <td class="style1" align="center" height="20px">
					     </tr>
                                           <?
                                            }   //END ASSESSED DATABASE FETCH
                                           ?>
				       </table>
				    </td>
				</tr> 
                                <tr>
                                   <td bgcolor="#FFFFFF">&nbsp;</td>
                                </tr>
                                    
                                <!-- MAIN RELOCATIONS PLANNED TABLE -->
                                <tr>
				    <td align="center" bgcolor="#E3F6CE">
				       <h2>Relocations Planned:</h2>
				    
                                       <table cellpadding="5" cellspacing="0" border="1" width="100%" bordercolor="#ffffff" >
                                          <tr>
                                             <td  align="center"><strong>Fullname</strong></td>
					     <td  align="center"><strong>Consumer ID</strong></td>
					     <td  align="center"><strong>Planned On</strong></td>
   				             <td  align="center"><strong>Nursing Facility</strong></td>
					     <td  align="center"><strong>Assigned Coordinator</strong></td>
					  </tr>
  				         
                                         <?php
                                              
                                            while($relocations_planned_consumer_info = mysql_fetch_array($consumer_relocations_planned)){
   
                                                $relocation_planned_consumer_id                =$relocations_planned_consumer_info['consumer_id'];
                                                $relocation_planned_consumer_fullname          =$relocations_planned_consumer_info['consumer_fullname'];
                                                $relocation_planned_consumer_date              =$relocations_planned_consumer_info['consumer_date'];
                                                $relocation_planned_consumer_nursing_facility  =$relocations_planned_consumer_info['consumer_nursing_facility'];
                                                $relocation_planned_consumer_coordinator       =$relocations_planned_consumer_info['consumer_coordinator']; 
                                         ?>										      
                                         
                                         <tr>
                                            <td align="center">
                                               <a href="show_profile.php?consumer_id=<?=$relocation_planned_consumer_id?>">
                                                  <?=$relocation_planned_consumer_fullname?>
                                               </a>
                                                      </td>
                                                      <td class="style1" align="center" height="20px">
                                                          <?=$c_id?>
                                                      </td>
					                                        <td class="style1" align="center" height="20px">
                                                          <?=$c_date?>
                                                       </td>
                                                       <td class="style1" align="center" height="20px">
                                                          <?=$c_nursing_facility?>
                                                        </td>
                                                        <td class="style1" align="center" height="20px">
                                                          <?=$c_coordinator?>
                                                        </td>											

					 	                                      <td class="style1" align="center" height="20px">
                                                          <a href="#" class="style" onClick="delRecord('<?=$FetchPaidUser['cart_id']?>','<?=$FetchPaidUser['id']?>');">
                                                             <img src="images/b_drop.png" alt="Delete" border="0" height="16">
                                                          </a>
                                                        </td>
					                                     </tr>
                                                    <?
                                                       }//END DATABASE FETCH
                                                    ?>
					                                </table>
				                                 </td>
				                              </tr> 
                                    <tr>
                                       <td bgcolor="#FFFFFF">&nbsp;</td>
                                    </tr>
                                    
                                    
                                <!-- MAIN RELOCATIONS COMPLETED TABLE -->
                                <tr>
				                        <td align="center" bgcolor="#EEEEEE">
				                           <h2>Relocations Completed:</h2>
				                           <table cellpadding="5" cellspacing="0" border="1" width="100%" bordercolor="#ffffff" >
                                          <tr>
                                               <td  align="center"><strong>Fullname</strong></td>
					                                <td  align="center"><strong>Consumer ID</strong></td>
					                                <td  align="center"><strong>Completed On</strong></td>
   				                                <td  align="center"><strong>From Nursing Facility</strong></td>
					                                <td  align="center"><strong>Assigned Coordinator</strong></td>
					                           </tr>
  				         
                                         <? //FETCH DATA FROM THE DATABASE!!!

                                              /**************************************************/
                                              /*   $FetchPaidUser[] used to populate GET vars   */
                                              /**************************************************/
                                              
                                              while($relocations_completed_consumer_info = mysql_fetch_array($consumer_relocations_completed)){
   
                                                   $c_id                =$relocations_completed_consumer_info['c_id'];
                                                   $c_fullname          =$relocations_completed_consumer_info['c_fullname'];
                                                   $c_date              =$relocations_completed_consumer_info['c_date'];
                                                   $c_nursing_facility  =$relocations_completed_consumer_info['c_nursing_facility'];
                                                   $c_coordinator       =$relocations_completed_consumer_info['c_coordinator']; 
                                          ?>										      
                                                   <tr>
                                                      <td align="center">
                                                          <a href="show_profile.php?c_id=<?=$c_id?>">
                                                              <?=$c_fullname?>
                                                          </a>
                                                      </td>
                                                      <td class="style1" align="center" height="20px">
                                                          <?=$c_id?>
                                                      </td>
					                                        <td class="style1" align="center" height="20px">
                                                          <?=$c_date?>
                                                       </td>
                                                       <td class="style1" align="center" height="20px">
                                                          <?=$c_nursing_facility?>
                                                        </td>
                                                        <td class="style1" align="center" height="20px">
                                                          <?=$c_coordinator?>
                                                        </td>											

					 	                                      <td class="style1" align="center" height="20px">
                                                          <a href="#" class="style" onClick="delRecord('<?=$FetchPaidUser['cart_id']?>','<?=$FetchPaidUser['id']?>');">
                                                             <img src="images/b_drop.png" alt="Delete" border="0" height="16">
                                                          </a>
                                                        </td>
					                                     </tr>
                                                    <?
                                                       }//END DATABASE FETCH
                                                    ?>
					                                </table>
				                                 </td>
				                              </tr>                                     
				    <tr bgcolor="#FFFFFF">
				    <tr bgcolor="#FFFFFF">
				       <td align="center">&nbsp;</td>
				    </tr>
				</tbody>
			   </form>
		        </table>
		     </td>
	          </tr>
              </tbody>
           </table>
         </td>
     </tr>
  </tbody>
</table>
<div class="footer">
			<p>| <a href="#">RSS Feed</a> | 
         <a href="#">Contact</a> | 
         <a href="#">Disclaimer</a> | 
         <br />
			&copy; COPYLEFT 2007 ARCIL,Inc. All technology used for this site is licensed under <a href="http://www.gnu.org/copyleft/gpl.html" title="Find out more about GPL">The GPL</a></p>
		</div>
 </div><!-- END CONTENT DIV -->
</body>
</html>

